<template>
  <textarea
    v-if="type === 'textarea'"
    :value="value"
    @input="inputChnage"
    class="h_input"
    type="text"
    @focus="$emit('focus')"
    @blur="$emit('blur')"
    @keydown="$emit('keydown')"
  />
  <input
    v-else
    :value="value"
    @input="inputChnage"
    class="h_input"
    type="type"
    @focus="$emit('focus')"
    @blur="$emit('blur')"
    @keydown="$emit('keydown')"
  />
</template>

<script>
export default {
  props: {
    value: {},
    type: {
      type: String,
      default: "text",
    },
  },
  methods: {
    inputChnage(e) {
      this.$emit("input", e.target.value);
    },
  },
};
</script>

<style lang="scss" scoped>
.h_input {
  width: 100%;
  border: 1px solid #dcdfe6;
  border-radius: 5px;
  padding: 7px 10px;
  transition: 0.3s;
  &:focus {
    outline: 0;
    border: 1px solid #195fff !important;
  }
}
</style>
